#pragma once

#include <cstddef> // for std::size_t

#include "platform.h"

class MemoryReader
{
public:
	template <class POD>
	bool read(const address_t address, POD& Object) const
	{
		std::size_t size = sizeof(POD);
		bool ret = read_(address, size, (unsigned char*)&Object);
		return ret;
	}

	bool read(const address_t address, const std::size_t size, unsigned char* buf) const;

	virtual ~MemoryReader(void) {} ;

protected:
	virtual bool read_(const address_t address, const std::size_t size, byte* buf) const = 0;
};
